<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>应用列表 - {$enterprise.title} - {$siteConfig.siteName}</title>
    <meta name="keywords" content="{$siteConfig.siteKeyword}"/>
    <meta name="description" content="{$siteConfig.siteDesc}"/>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="{$siteConfig.favicon}" type="image/x-icon" rel="shortcut icon"/>
    <link rel="stylesheet" href="__LAYUI__/css/layui.css?v=__V__" media="all">
    <link rel="stylesheet" href="//at.alicdn.com/t/__ICON_FONT_VERSION__.css?v=__V__" media="all">
    <link rel="stylesheet" href="__CSS__/mobile.css?v=__V__" media="all">
    <script src="__JS__/jquery.min.js?v=__V__" charset="utf-8"></script>
    <script src="__LAYUI__/layui.js?v=__V__" charset="utf-8"></script>
    <script src="__JS__/common.js?v=__V__" charset="utf-8"></script>

    {php} if(\think\App::$debug){ {/php}
    <!-- 调试窗口 -->
    <script src="__JS__/vconsole/vconsole.min.js?v=__V__" charset="utf-8"></script>
    <script>
        // 调试窗口初始化
        new VConsole();
    </script>
    {php} } {/php}

    <!-- 钉钉js api对象 -->
    {if condition="isset($env) && $env.dingMobile"}
    <script src="https://g.alicdn.com/dingding/open-develop/1.6.9/dingtalk.js"></script>
    <script>
        var d = dd;
    </script>
    {elseif condition="isset($env) && $env.dingPc"/}
    <script src="https://g.alicdn.com/dingding/dingtalk-pc-api/2.7.0/index.js"></script>
    <script>
        var d = DingTalkPC;
    </script>
    {else/}
    <script>
        var d = false;
    </script>
    {/if}

    <!-- js api配置 -->
    {if condition="!empty($jsapiConfig)"}
    <script>
        var jsapiConfig = {$jsapiConfigJson};
        if (d) {
            d.config(jsapiConfig);
        }
    </script>
    {/if}

    <script>
        if (d) {
            d.error(function (error) {
                console.error(error);
                layer.alert("jsapi错误提示: " + (error.message || error.errorMessage));
            });
        }
    </script>

    <!-- 设置钉钉分享标题 -->
    <script>
        $(document).ready(function () {
            (typeof dd != "undefined") && dd.ready(function () {
                dd.biz.navigation.setRight({
                    show: true,//控制按钮显示， true 显示， false 隐藏， 默认true
                    control: true,//是否控制点击事件，true 控制，false 不控制， 默认false
                    text: '更多',//控制显示文本，空字符串表示显示默认文本
                    onSuccess: function (result) {
                        var title = $("head meta[name='shareTitle']").attr("content");
                        if (!title || title == ('[' + 'shareTitle' + ']')) {
                            title = document.title;
                        }
                        var content = $("head meta[name='shareDesc']").attr("content");
                        if (!content || content == ('[' + 'shareDesc' + ']')) {
                            content = $("head meta[name='description']").attr("content");
                        }
                        var image = $("head meta[name='shareImage']").attr("content");
                        if (!image || image == ('[' + 'shareImage' + ']')) {
                            image = document.location.protocol + "//" + document.location.host +
                                (document.location.port ? (":" + document.location.port) : "") +
                                "/static/images/slogo.png";
                        }
                        dd.biz.util.share({
                            type: 0,//分享类型，0:全部组件 默认； 1:只能分享到钉钉；2:不能分享，只有刷新按钮
                            url: document.location.href,
                            title: title,
                            content: content,
                            image: image,
                            onSuccess: function () {
                                //onSuccess将在分享完成之后回调
                            },
                            onFail: function (err) {
                            }
                        })
                    },
                    onFail: function (err) {
                        console.log(err);
                    }
                });
            });
        });
    </script>
</head>

<body class="layui-layout-body" style="overflow: auto;">

<style>

    html {
        background: #f8f8f8;
    }

    body {
        max-width: 25rem;
        margin: 0 auto;
    }

    .layui-card {
        margin-bottom: 0px;
        border-bottom: solid 1px #eee;
    }

    .layui-card-header {
        font-size: 1rem;
        border-bottom: none;
        color: #121212;
        padding-top: 10px;
    }

    .entry {
        text-align: center;
        margin-bottom: 15px;
    }

    .entry img {
        width: 40%;
    }

    .entry .title {
        margin-top: 5px;
        color: #333;
        white-space: nowrap;
        width: 100%;
        text-overflow: ellipsis;
        overflow: hidden;
    }
</style>

{foreach name="modules" item="module"}
<div class="layui-card">
    <div class="layui-card-header">{$module.title}</div>
    <div class="layui-card-body">
        <div class="layui-row">
            {foreach name="module.entries" item="entry"}
            <div class="layui-col-xs3 entry">
                <a href="{$entry.link}">
                    <div class="img">
                        <img src="{$entry.img}" onerror="this.src='/static/images/module.png';"/>
                    </div>
                    <div class="title">
                        {$entry.title}
                    </div>
                </a>
            </div>
            {/foreach}
        </div>
    </div>
</div>
{/foreach}
</body>
</html>